import { Define, EntityObjectFactory } from 'tiny-entity2';
import { OrganizationTree } from './organizationTree';
import { Account } from './account';
const EntityObjectType = EntityObjectFactory.GetEntityObjectType(process.env.dataBaseType || 'mysql');
@Define.Table({ TableName: "user" })
export class User extends EntityObjectType<User>{
    @Define.PrimaryKey()
    id: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    employeeNo: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true
    })
    organizationId: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    accountId: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true
    })
    name: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    gender: string;

    @Define.Column({
        DataType: Define.DataType.BIGINT,
        NotAllowNULL: true
    })
    createTime: number;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    phone: string;

    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    birth: number;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    status: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    position: string;

    @Define.Column({
        DataType: Define.DataType.BOOL
    })
    isDelete: boolean;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    headerPhoto: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    idCard: string;

    orgTree:OrganizationTree;

    acc:Account;

    depName:string;
}

export const EmployeeStatus = {
    Disable: 'disable'
}